home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 233 / Computer Shopper 233 / ComputerShopperDVD233.iso / mpf / eng / shared / agentdui.cab / scui.dll / HTML / MCDASH.VBS < prev    next >
Encoding:
Text File  |  2005-07-27  |  2.4 KB  |  97 lines

  1. ' This file contains the global objects used by all application pages and McDash.htm
  2. ' This file can only be included in McDash.htm...
  3.  
  4. Option Explicit
  5.  
  6. Dim gObjDashboard
  7. Dim gobjExternal, gDBobjReg
  8. Dim gDBobjOS
  9. Dim gDBobjFS
  10. Dim gDBobjShell
  11.  
  12. Function InitializeGlobals()
  13. '{
  14.     Dim bInitSuccess
  15.  
  16.     Set gobjExternal = nothing
  17.     Set gDBobjReg = nothing
  18.     Set gObjDashboard = nothing
  19.     Set gDBobjOS = nothing
  20.     Set gDBobjFS = nothing
  21.     Set gDBobjShell = nothing
  22.  
  23.     bInitSuccess = TRUE
  24.     Dim bSetExternalObject
  25.     bSetExternalObject = SetExternalObject( gobjExternal )
  26.  
  27.     If FALSE = bSetExternalObject Then
  28.         bInitSuccess = FALSE
  29.     End If
  30.  
  31.     ' Create Registry object...
  32.     Set gDBobjReg = gobjExternal.CreateObject( CLSID_CoMCRegistry, CLSID_LIC, true ) 
  33.     If gDBobjReg is nothing Then
  34.         bInitSuccess = FALSE
  35.     End If
  36.  
  37.     gDBobjReg.obfuscate = TRUE
  38.     
  39.     ' Create OS object...
  40.     Set gDBobjOS = gobjExternal.CreateObject( CLSID_CoMCOS, CLSID_LIC, true )
  41.     If gDBobjOS is nothing Then
  42.         bInitSuccess = FALSE
  43.     End If
  44.  
  45.     ' Create FS object...
  46.     Set gDBobjFS = gobjExternal.CreateObject( CLSID_CoMCFileSystem, CLSID_LIC, true )
  47.     If gDBobjFS is nothing Then
  48.         bInitSuccess = FALSE
  49.     End If
  50.  
  51.     ' Create SHELL object...
  52.     Set gDBobjShell = gobjExternal.CreateObject( CLSID_CoMCShell, CLSID_LIC, true )
  53.     If gDBobjShell is nothing Then
  54.         bInitSuccess = FALSE
  55.     End If
  56.  
  57.     InitializeGlobals = bInitSuccess
  58. '}
  59. End Function
  60.  
  61.  
  62. '/////////////////////////////////////////////////////////////////////////////
  63. '// Sets the window.external object to "objExternal".
  64. '// It also makes sure that window.external is the external object exposed
  65. '// by MgHtml.
  66. '// Returns : True, if objExternal is set and valid. 
  67. '// Else objExternal = nothing and function returns False.
  68. '/////////////////////////////////////////////////////////////////////////////
  69.  
  70. Function SetExternalObject( ByRef objExternal )
  71. '{
  72.     Dim   nLastError
  73.  
  74.     On Error Resume Next  ' This is local for this function.
  75.  
  76.     Set objExternal = nothing
  77.     SetExternalObject = False
  78.     If IsObject( window.external ) And not window.external is nothing Then
  79.     '{
  80.         Set objExternal = window.external
  81.         Err.Clear
  82.         nLastError = Err.Number
  83.         objExternal.ReturnValue = CLng(-1)
  84.         If Err.Number <> nLastError Then
  85.         '{
  86.             Set objExternal = nothing
  87.             Exit Function
  88.         '}
  89.         End If
  90.         SetExternalObject = True
  91.     '}
  92.     End If
  93. '}
  94. End Function
  95.  
  96.  
  97.